<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataListAndDropDownList.aspx.cs" Inherits="DataListAndDropDownList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div>
            <table width="50%">
                <tr>
                    <td style="width: 432px; height: 24px">
                        Country:
                        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
                            DataTextField="ProvinceName" DataValueField="ProvinceID" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
                            Width="189px">
                        </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitVietnamDbConnectionString %>"
                            SelectCommand="SELECT [ProvinceID], [ProvinceName] FROM [tblProvinces]"></asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td style="width: 432px">
                        <asp:DataList ID="DataList1" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
                            Width="622px">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Font-Bold="True" Text='<%# Bind("CompanyName") %>'
                                    Width="220px"></asp:Label><br />
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Email") %>' Width="220px"></asp:Label>
                                <br />
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("Address") %>' Width="220px"></asp:Label><br />
                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("Phone") %>' Width="220px"></asp:Label><br />
                                <br />
                            </ItemTemplate>
                        </asp:DataList></td>
                </tr>
            </table>
            &nbsp;
        </div>
    
    </div>
    </form>
</body>
</html>
